﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Petaframe.DataAccess
{
    public abstract class SqlCommandStringBuilderBase : IDisposable 
    {
         protected StringBuilder _sqlQuery;

         public SqlCommandStringBuilderBase()
        {
            _sqlQuery = new StringBuilder(32);           
        }
            
        
        /// <summary>
        /// Oluşturulan sql komutunu döndürür.
        /// </summary>
        /// <returns>Sql command string</returns>
        public override string ToString()
        {
            return _sqlQuery.ToString();
        }


        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                _sqlQuery = null;
               
            }
        }
        ~SqlCommandStringBuilderBase()
        {
            Dispose(false);
        }
            
    }
}
